package com.chanzany.builder.improve;

//指挥者，动态地指定制作流程，返回产品
public class HouseDirector {
    //构造器传入或setter传入
    private HouseBuilder builder;

    public HouseDirector(HouseBuilder builder) {
        this.builder = builder;
    }

    public void setBuilder(HouseBuilder builder) {
        this.builder = builder;
    }

    //处理建房子的流程交给指挥者
    public House constructHouse(){
        builder.buildBasic();
        builder.buildWall();
        builder.roofed();
        return builder.build();
    }
}
